using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using FutureOpen.Core;
using FutureOpen.Core.func;
using FutureOpen.Core.func.db;
using FutureOpen.Core.func.sql;
using System.Collections.Generic;


public partial class test_RecommendList : FutureOpen.Web.Pages.PageBase
{
    //private MyUsr myusr = new MyUsr();
    protected void Page_Load(object sender, EventArgs e)
    {
        base.PageInit();
        if (!base.IsLogin())
        {
            base.SimulateLogin();
        }

        if (!IsPostBack)
        {
            AspNetPager1.PageSize = 20;
            AspNetPager1.RecordCount = MailProvider.GetRecieveMSGCount(MyUsr, MailProvider.MsgType_Recommend);
            BindMsgs(0, 20);
        }
    }



    private void BindMsgs(int start, int count)
    {
        DataSet ds = MailProvider.GetRecieveMSG(MyUsr, MailProvider.MsgType_Recommend, start, count);
        DataList1.DataSource = ds.Tables[0];
        DataList1.DataBind();
    }   


    protected void AspNetPager1_PageChanging(object src, Wuqi.Webdiyer.PageChangingEventArgs e)
    {
        AspNetPager1.CurrentPageIndex = e.NewPageIndex;
        BindMsgs((e.NewPageIndex - 1) * 20, 20);
    }
    public string GetUsrName(object obj1, object obj2)
    {
        return this.GetUsrUrl(Convert.ToInt32(obj1), obj2.ToString());       
    }
}
